package com.deepclassifieds.daas.api;

import java.util.UUID;

import com.deepclassifieds.daas.api.xsd.ColumnDef;
import com.deepclassifieds.daas.api.xsd.ColumnDefs;
import com.deepclassifieds.daas.api.xsd.Database;
import com.deepclassifieds.daas.api.xsd.Record;
import com.deepclassifieds.daas.api.xsd.Records;
import com.deepclassifieds.daas.api.xsd.Shard;
import com.deepclassifieds.daas.api.xsd.Table;
import com.deepclassifieds.daas.common.Name;

public interface DaasShardService extends DaasService {

	//
	// DDL
	//
	
	Table      createTable(Database database, Shard shard, Name tableName, ColumnDefs columnDefs);
	void       dropTable(Database database, Shard shard, Table table);
	
	void       alterTableAddColumn(Database database, Shard shard, Table table, ColumnDef columnDef);
	void       alterTableDropColumn(Database database, Shard shard, Table table, Name columnName);

	Database   createDatabase(Name databaseName, Shard shard);
	void       dropDatabase(Database database, Shard shard);
	
	//
	// DML
	//
	
	Record     selectRecordByUUID(Database database, Shard shard, Table table, UUID uuid);
	Records    selectRecords(Database database, Shard shard, Table table, DaasExpression where);
	void       deleteRecordByUUID(Database database, Shard shard, Table table, UUID uuid);
	
}
